<?php
/**
 * @version      BOSSCMS-Free
 * @trademark    BOSSCMS
 * @copyright    Copyright © by BOSSCMS-Free (https://www.bosscms.net/) 保留所有权利
 * @license      https://gitee.com/Greenpeas/BOSSCMS/license/ 和 https://www.bosscms.net/freelicense/
 * @link         https://www.bosscms.net/
 * @author       温州软界网络技术有限公司
**/
defined('IS_OK') or exit('Access Forbidden');
?>
<?php if(!isset($G['no_copyright']) && $G['config']['admin_copyright_name']){ ?>
<section class="copyright">
  <p><?php echo $G['copyright']; ?></p>
</section>
<?php } ?>
<?php if(!isset($G['no_easy'])){ ?>
<section class="easy <?php if($G['get']['win']) echo 'active'; ?>">
  <div class="window">
    <div class="icon">
      <span class="full">
        <em class="fa fa-expand"></em>
        <em class="fa fa-compress"></em>
      </span>
      <span class="close"><em class="fa fa-times"></em></span>
    </div>
    <div class="move"></div>
    <iframe></iframe>
  </div>
</section>
<?php } ?>
<script>
$.P = '<?php echo P; ?>';
$G = $ext = [];
$G['bosscms']=true;
$G['version']='<?php echo $G['config']['version']; ?>';
$G['host']='<?php echo $G['path']['host']; ?>';
$G['defaults']=<?php echo $G['language']['defaults']; ?>;
$G['lang']=<?php echo $G['language']['id']; ?>;
$G['relative']='<?php echo $G['path']['relative']; ?>';
$G['theme']='<?php echo $G['config']['web_theme']; ?>';
$G['upload']='<?php echo url::upload('..//upload/','sub',$G['path']['relative']); ?>';
$G['mold']='<?php echo $G['get']['mold']; ?>';
$G['part']='<?php echo $G['get']['part']; ?>';
$G['func']='<?php echo $G['get']['func']; ?>';
$G['items']=<?php echo isset($G['get']['items'])?$G['get']['items']:0; ?>;
$G['easy']='';
$G['csrftoken']='<?php echo session::get('csrftoken'); ?>';
<?php if($G['manager'] && $G['config']['user_sequence']){ ?>
$G['user']='<?php echo $G['config']['user_sequence']; ?>';
<?php } ?>
<?php into::basic_json('extension'); ?>
<?php foreach($G['extension'] as $k=>$v){ ?>
$ext['<?php echo $k; ?>']=<?php echo json::encode($v); ?>;
<?php } ?>
</script>

<?php echo html::script($G['path']['relative'].'system/extend/ueditor/ueditor.config.js'); ?>
<?php
$G['uefile'] = 'cache/js/ueditor.admin.js';
if(!is_file(ROOT_PATH.$G['uefile'])){
    preg_replace_callback('/paths\s*\=\s*\[([\s\S]+?)\]\;/',function($match){
        global $G;
        preg_match_all('/\'([\w\.\/]+?)\'/',$match[1],$mat);
        $js = '';
        foreach($mat[1] as $v){
            if($v){
                $js .= file_get_contents(ROOT_PATH.'system/extend/ueditor/_src/'.$v)."\n\n";
            }
        }
        dir::create(ROOT_PATH.$G['uefile'], $js);
    },file_get_contents(ROOT_PATH.'system/extend/ueditor/editor_api.js'));
}
echo html::script($G['path']['relative'].$G['uefile']);
?>
<?php echo html::script(load::common('js/bosscms.js','admin',true)); ?>
<?php echo html::script(load::theme('js/'.BOSSCMS_MOLD.'.js','admin',true)); ?>
<?php echo html::script(load::theme('js/'.BOSSCMS_MOLD.'_'.BOSSCMS_PART.'.js','admin',true)); ?>
</body>
</html>